<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:util="http://java.sun.com/jsf/composite/components/util"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:p="http://primefaces.prime.com.tr/ui" 
                xmlns:f="http://java.sun.com/jsf/core">

    <div id="favList">
        
        <h:form id="favForm">
            
            <p:dataTable id="favTable" var="favUser" value="#{favoritesBackingBean.friends}"
                paginator="true" rows="10"
                selection="#{favoritesBackingBean.selectedUser}"
                selectionMode="single"
                paginatorAlwaysVisible="false"
                rowSelectListener="#{favoritesBackingBean.navigate}"
                update="clientid">
                
            <p:column>
                <h:graphicImage id="favImage" url="#{favUser.profilePic}"/>
            </p:column>
            
            <p:column sortBy="#{favUser.username}">
                <f:facet name="header">
                    <h:outputText value="#{msg.searchResultsUsername}" />
                </f:facet>
                <h:outputText value="#{favUser.username}" />
            </p:column>
            
           <p:column>
           <p:commandButton id="sendMessageButton" ajax="false" value="#{msg.sendMessageButton}"
                   actionListener="#{favoritesBackingBean.sendMessage}"  action="#{favoritesBackingBean.sendMessage}">
			   <f:attribute name="user" value="#{favUser.username}" />
		   </p:commandButton>
           </p:column>
            
        </p:dataTable>
            
        </h:form>
    </div>
</ui:composition>   